﻿using System;
using System.Data.Entity;

/**
 * FollowMe Server
 * UWRF CS425 & CS343 Project Fall 2014
 * Adam Drews
 *   email adam.drews@my.uwrf.edu
 * Tyler Johnson
 *   email tyler.johnson@my.uwrf.edu
 * Nicholas Thorp
 *   email nicholas.thorp@my.uwrf.edu
 */
namespace FollowMe.Repository
{
    /// <summary>
    /// This context exposes the DBContext functions required by this application
    /// </summary>
    public interface IContext
    {
        /// <summary>
        /// Gets the dbset.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity.</typeparam>
        /// <returns>A IDBSet</returns>
         IDbSet<TEntity> getSet<TEntity>() where TEntity : class;
         
         /// <summary>
         /// Marks the entity deleted.
         /// </summary>
         /// <typeparam name="TEntity">The type of the entity.</typeparam>
         /// <param name="entity">The entity.</param>
         void markDeleted<TEntity>(TEntity entity) where TEntity : class;
         
         /// <summary>
         /// Marks entity modified.
         /// </summary>
         /// <typeparam name="TEntity">The type of the entity.</typeparam>
         /// <param name="entity">The entity.</param>
         void markModified<TEntity>(TEntity entity) where TEntity : class;
         
         /// <summary>
         /// Determines whether the specified entity is detached.
         /// </summary>
         /// <typeparam name="TEntity">The type of the entity.</typeparam>
         /// <param name="entity">The entity.</param>
         /// <returns></returns>
         Boolean isDetached<TEntity>(TEntity entity) where TEntity : class;
         
         /// <summary>
         /// Saves the changes.
         /// </summary>
         /// <returns></returns>
         int SaveChanges();
    }
}
